import React from "react";

interface IProps {
  readonly count: number;
  increment: () => void;
  decrement: () => void;
}

export default function Count({ count, increment, decrement }: IProps) {
  return (
    <div>
      <h3>计数器</h3>
      <div>count: {count}</div>
      <p>
        <button onClick={increment}>+</button>
        <button onClick={decrement}>-</button>
      </p>
    </div>
  );
}
